[IA64] vcpu_match_tr_entry
authorawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Fri, 31 Mar 2006 21:03:07 +0000 (14:03 -0700)
committerawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Fri, 31 Mar 2006 21:03:07 +0000 (14:03 -0700)
cpu_match_tr_entry moved from vcpu.h to vcpu.c, is now an inlined function
and its range check is fixed.

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
xen/arch/ia64/xen/vcpu.c
xen/include/asm-ia64/vcpu.h

index 10abd30aca48ed88b9f6b203adf27ccd06004041..5d3e989db272d3483fe6527d09531d43b4b6eaed 100644 (file)
@@ -1273,6 +1273,14 @@ unsigned long recover_to_break_fault_count = 0;
 
 int warn_region0_address = 0; // FIXME later: tie to a boot parameter?
 
+// FIXME: also need to check && (!trp->key || vcpu_pkr_match(trp->key))
+static inline int vcpu_match_tr_entry(TR_ENTRY *trp, UINT64 ifa, UINT64 rid)
+{
+       return trp->p && trp->rid == rid 
+               && ifa >= trp->vadr
+               && ifa <= (trp->vadr + (1L << trp->ps) - 1);
+}
+
 IA64FAULT vcpu_translate(VCPU *vcpu, UINT64 address, BOOLEAN is_data, BOOLEAN in_tpa, UINT64 *pteval, UINT64 *itir, UINT64 *iha)
 {
        unsigned long region = address >> 61;
index c38e2fc590eaf6328962da1be350109a2bd76eca..a7c5f1a9fda1d282afc6c317277392a26b13dbe5 100644 (file)
@@ -16,6 +16,7 @@ typedef       struct vcpu VCPU;
 typedef cpu_user_regs_t REGS;
 
 
+/* Note: PSCB stands for Privilegied State Communication Block.  */
 #define VCPU(_v,_x)    (_v->arch.privregs->_x)
 #define PSCB(_v,_x) VCPU(_v,_x)
 #define PSCBX(_v,_x) (_v->arch._x)
@@ -185,10 +186,5 @@ itir_mask(UINT64 itir)
 #define vcpu_quick_region_set(_tr_regions,_ifa)             \
     do {_tr_regions |= (1 << ((unsigned long)_ifa >> 61)); } while (0)
 
-// FIXME: also need to check && (!trp->key || vcpu_pkr_match(trp->key))
-#define vcpu_match_tr_entry(_trp,_ifa,_rid)             \
-    ((_trp->p && (_trp->rid==_rid) && (_ifa >= _trp->vadr) &&   \
-    (_ifa < (_trp->vadr + (1L<< _trp->ps)) - 1)))
-
 
 #endif